﻿-- =============================================
-- Author:      Sergey Solyanik
-- Create date: 7/25/09
-- Description: Adds a document version
-- =============================================
CREATE PROCEDURE [dbo].[AddVersion]
	@Contents VARBINARY (MAX),
	@DocumentId INT,
	@Result INT OUTPUT
AS
    INSERT INTO dbo.DocumentVersion (DocumentId, TimeStamp, Contents)
        VALUES(@DocumentId, GETUTCDATE(), @Contents)
    SET @Result = @@IDENTITY
RETURN 0